package com.ereach;

import java.util.ArrayList;
import java.util.Collections;
import java.util.List;

public class MainUser {
    public static void main(String[] args) {
        List<User> users = new ArrayList<>();

        users.add(new User("Tom", "male", 82, "e2"));
        users.add(new User("Jerry", "male", 30, "e1"));
        users.add(new User("Cindy", "female", 18, "e3"));

        for (var x : users)
            System.out.println(x);

        System.out.println("===");

        Collections.sort(users);

        for (var x : users)
            System.out.println(x);

        System.out.println("===");

        Collections.sort(users, new EmailComparator());
        for (var x : users)
            System.out.println(x);

    }
}
